<?php
/**
 * Author: Traveler
 * Time  : 2021/9/4 15:22
 */

namespace app;


class ErrorCode
{
    // 成功
    const SUCCESS = [0, '成功'];

    // 请求
    const ILLEGAL_REQUEST    = [1001, '非法请求'];
    const REQUEST_TIMEOUT    = [1002, '请求超时'];
    const MISSING_PARAMETERS = [1003, '参数缺失'];
    const INVALID_DATA       = [1004, '数据无效'];

    // 登录与密码
    const INCORRECT_LOGIN      = [1101, '用户名或密码不正确'];
    const USER_DISABLED        = [1102, '用户被禁用'];
    const USER_ABNORMAL        = [1103, '用户状态异常'];
    const INVALID_PASSWORD_LEN = [1104, '密码长度无效'];
    const REQUIRE_OLD_PASSWORD = [1105, '旧密码字段缺失'];
    const REQUIRE_NEW_PASSWORD = [1106, '新密码字段缺失'];
    const REQUIRE_REP_PASSWORD = [1107, '重复密码字段缺失'];
    const PASSWORD_NOT_CONFIRM = [1108, '新密码与重复密码不一致'];
    const SAME_PASSWORD        = [1109, '新密码与旧密码相同'];
    const INVALID_OLD_PASSWORD = [1110, '旧密码不正确'];

    // 鉴权
    const INVALID_TOKEN     = [1201, 'token无效'];
    const INVALID_SIGNATURE = [1202, '签名无效'];

    // 通用操作
    const DATA_NOT_FOUND       = [1301, '未找到数据'];
    const CREATE_FAILED        = [1302, '添加失败'];
    const UPDATE_FAILED        = [1303, '修改失败'];
    const DELETE_FAILED        = [1304, '删除失败'];
    const SAVE_FAILED          = [1305, '保存失败'];
    const HAS_CHILD_MENU       = [1306, '该菜单存在子菜单，无法删除'];
    const CATE_USING           = [1307, '该分类仍在使用，无法删除'];
    const DEPARTMENT_USING     = [1308, '该部门仍在使用，无法删除'];
    const ROLE_USING           = [1309, '该角色仍在使用，无法删除'];
    const ISP_USING            = [1310, '该运营商仍在使用，无法删除'];
    const UNKNOWN_VALIDATE_MSG = [1311, '未定义的验证消息'];
    const REQUIRE_GENDER       = [1312, '性别字段缺失'];
    const INVALID_GENDER       = [1313, '性别无效'];
    const REQUIRE_CELLPHONE    = [1314, '手机号码字段缺失'];
    const INVALID_CELLPHONE    = [1315, '手机号码无效'];
    const DUPLICATE_CELLPHONE  = [1316, '手机号码重复'];

    // 场所
    const REQUIRE_ICAFE_NAME       = [5001, '场所名称字段缺失'];
    const INVALID_ICAFE_NAME_LEN   = [5002, '场所名称长度超限'];
    const REQUIRE_CATEGORY_ID      = [5003, '场所分类字段缺失'];
    const INVALID_CATEGORY_ID      = [5004, '场所分类ID无效'];
    const REQUIRE_CONTACT          = [5005, '联系人字段缺失'];
    const INVALID_CONTACT_LEN      = [5006, '联系人长度超限'];
    const REQUIRE_REGION_ID        = [5007, '地址三级联动ID字段缺失'];
    const INVALID_REGION_ID        = [5008, '地址三级联动ID无效'];
    const REQUIRE_ICAFE_STATUS     = [5009, '场所状态字段缺失'];
    const INVALID_ICAFE_STATUS     = [5010, '场所状态无效'];
    const REQUIRE_ISP_ID           = [5011, '运营商ID字段缺失'];
    const INVALID_ISP_ID           = [5012, '运营商ID无效'];
    const REQUIRE_BANDWIDTH        = [5013, '带宽字段缺失'];
    const INVALID_BANDWIDTH        = [5014, '带宽无效'];
    const REQUIRE_IP               = [5015, 'IP地址字段缺失'];
    const INVALID_IP               = [5016, 'IP地址无效'];
    const REQUIRE_MASK             = [5017, '子网掩码字段缺失'];
    const INVALID_MASK             = [5018, '子网掩码无效'];
    const REQUIRE_GATEWAY          = [5019, '网关字段缺失'];
    const INVALID_GATEWAY          = [5020, '网关无效'];
    const REQUIRE_PROTOCOL         = [5021, '访问协议字段缺失'];
    const REQUIRE_PORT             = [5022, '访问端口字段缺失'];
    const INVALID_PORT             = [5023, '访问端口无效'];
    const REQUIRE_ACCOUNT          = [5024, '宽带账号字段缺失'];
    const REQUIRE_PASSWORD         = [5025, '宽带密码字段缺失'];
    const INVALID_DEVICE_IP        = [5026, '设备IP地址无效'];
    const INVALID_PC_COUNT         = [5027, '终端数量无效'];
    const INVALID_CHARGE_CELLPHONE = [5028, '负责人电话无效'];

    // 场所分类
    const REQUIRE_ICAFE_CATEGORY_NAME     = [5101, '分类名称字段缺失'];
    const INVALID_ICAFE_CATEGORY_NAME_LEN = [5102, '分类名称长度超限'];
    const DUPLICATE_ICAFE_CATEGORY_NAME   = [5103, '分类名称重复'];
    const REQUIRE_ICAFE_CATEGORY_STATUS   = [5104, '分类状态字段缺失'];
    const INVALID_ICAFE_CATEGORY_STATUS   = [5105, '分类状态无效'];

    // 用户
    const REQUIRE_USER_NAME     = [5201, '用户名称字段缺失'];
    const INVALID_USER_NAME_LEN = [5202, '用户名称长度超限'];
    const DUPLICATE_USER_NAME   = [5203, '用户名称重复'];
    const REQUIRE_USER_STATUS   = [5204, '用户状态字段缺失'];
    const INVALID_USER_STATUS   = [5205, '用户状态无效'];

    // 运营商
    const REQUIRE_ISP_NAME     = [5301, '运营商名称字段缺失'];
    const INVALID_ISP_NAME_LEN = [5302, '运营商名称长度超限'];
    const DUPLICATE_ISP_NAME   = [5303, '运营商名称重复'];
    const REQUIRE_ISP_STATUS   = [5304, '运营商状态字段缺失'];
    const INVALID_ISP_STATUS   = [5305, '运营商状态无效'];

    // 员工
    const REQUIRE_STAFF_NAME     = [5401, '员工名称字段缺失'];
    const INVALID_STAFF_NAME_LEN = [5402, '员工名称长度超限'];
    const DUPLICATE_STAFF_NAME   = [5403, '员工名称重复'];
    const REQUIRE_STAFF_STATUS   = [5404, '员工状态字段缺失'];
    const INVALID_STAFF_STATUS   = [5405, '员工状态无效'];
    const REQUIRE_DEPARTMENT_ID  = [5406, '部门ID字段缺失'];
    const INVALID_DEPARTMENT_ID  = [5407, '部门ID无效'];
    const REQUIRE_ROLE_ID        = [5408, '角色ID字段缺失'];
    const INVALID_ROLE_ID        = [5409, '角色ID无效'];
    const REQUIRE_STAFF_EMAIL    = [5410, '员工邮箱字段缺失'];
    const INVALID_STAFF_EMAIL    = [5411, '员工邮箱无效'];
    const DUPLICATE_STAFF_EMAIL  = [5412, '员工邮箱重复'];

    // 部门
    const REQUIRE_DEPARTMENT_NAME     = [5501, '部门名称字段缺失'];
    const INVALID_DEPARTMENT_NAME_LEN = [5502, '部门名称长度超限'];
    const DUPLICATE_DEPARTMENT_NAME   = [5503, '部门名称重复'];
    const REQUIRE_DEPARTMENT_STATUS   = [5504, '部门状态字段缺失'];
    const INVALID_DEPARTMENT_STATUS   = [5505, '部门状态无效'];

    // 角色
    const REQUIRE_ROLE_NAME        = [5601, '角色名称字段缺失'];
    const INVALID_ROLE_NAME_LEN    = [5602, '角色名称长度超限'];
    const DUPLICATE_ROLE_NAME      = [5603, '角色名称重复'];
    const REQUIRE_ROLE_STATUS      = [5604, '角色状态字段缺失'];
    const INVALID_ROLE_STATUS      = [5605, '角色状态无效'];
    const REQUIRE_PERMISSION_LIST  = [5606, '权限列表字段缺失'];
    const ASSIGN_PERMISSION_FAILED = [5607, '分配权限失败'];

    // 未知
    const UNKNOWN_ERROR = [9999, '未知错误'];
}